﻿/// <reference name="MicrosoftAjax.js"/>

Type.registerNamespace("YUIAspNet");

YUIAspNet.PieChart = function(element) {
    YUIAspNet.PieChart.initializeBase(this, [element]);
}

YUIAspNet.PieChart.prototype = {
    initialize: function() {
        YUIAspNet.PieChart.callBaseMethod(this, 'initialize');
    },
    
    initializeChartControl: function(sender, args) {
       
        var config = this._BuildConfig();
        
        config.dataField = this.get_DataField();
        config.categoryField = this.get_CategoryField();
                
        this._yuiControl = new YAHOO.widget.PieChart( this.get_ChartContainer(),
            this.get_DataSource(),
            config
	        );
   },
   
    get_DataField: function() {
        return this._dataField;
    },
    set_DataField: function(dataField) {
        this._dataField = dataField;
    },
    
    get_CategoryField: function() {
        return this._categoryField;
    },
    set_CategoryField: function(categoryField) {
        this._categoryField = categoryField;
    }
}

YUIAspNet.PieChart.registerClass('YUIAspNet.PieChart', YUIAspNet.BaseChart);
